import matplotlib.pyplot as plt
import numpy as np
import csv

# 指定要读取的 CSV 文件路径
csv_file_path = "data/_pdata/group2/test.csv"

# 指定要读取的行数
target_row = 107  # 例如，读取第 5 行

# 打开 CSV 文件
with open(csv_file_path, newline='') as csvfile:
    reader = csv.reader(csvfile)
    for i, row in enumerate(reader):
        if i == target_row-1:
            row = row[1:]
            x = [int(num) for num in row]
            break  # 找到目标行后退出循环
# print(x)
# x = [2236,2237,2232,2226,2217,2204,2191,2173,2154,2132,2108,2082,2055,2030,2007,1992,1999,1996,2000,2008,2012,2012,2011,2005,2000,1995,1993,1988,1986,1985,1982,1978,1977,1975,1974,1973,1972,1971,1970,1969,1968,1967,1966,1964,1966,1964,1960,1960,1960,1960,1951,1958,2026,2090,2062,2042,2024,2009,1996,1989,1985,1986,1988,1992,1999,2006,2013,2023,2033,2044,2054,2065,2073,2084,2094,2103,2114,2123,2130,2138,2145]
plt.plot(np.linspace(0, len(x), len(x)), x)
plt.show()
plt.close()